﻿@model CustomerAddressEditModel
@using SDF.Web.Models.Customer;
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";

    //title
    Html.AddTitleParts(T("PageTitle.Account").Text);
    Html.AppendPageCssClassParts("html-account-page");
    //page class
    Html.AppendPageCssClassParts("html-address-edit-page");
}
@section left
{
    @Html.Action("CustomerNavigation", "Customer", new { selectedTabId = CustomerNavigationEnum.Addresses })
}
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <div class="page account-page address-edit-page">
        <div class="page-title">
            <h1>@T("Account.MyAccount") - @T("Account.CustomerAddresses.AddNew")</h1>
        </div>
        <div class="page-body">
            @{
                var validationSummary = Html.ValidationSummary(true);
            }
            @if (!MvcHtmlString.IsNullOrEmpty(validationSummary))
            {
                <div class="message-error">
                    @validationSummary
                </div>
            }
            @{
            var dataDictAddress = new ViewDataDictionary();
            //Merge ModelState (required for validation)
            dataDictAddress.ModelState.Merge(ViewData.ModelState);
            dataDictAddress.TemplateInfo.HtmlFieldPrefix = "Address";
            @Html.Partial("_CreateOrUpdateAddress", Model.Address, dataDictAddress)
            }
            <div class="buttons">
                <input type="submit" class="button-1 save-address-button" value="@T("Common.Save")" />
            </div>
        </div>
    </div>
}